package com.devinlee.designpatterns.singleton;

/**
 * 单例模式-饿汉式
 */
public class Singleton1 {

    // 类加载的时候实例化
    private static Singleton1 singleton = new Singleton1();

    // private避免类在外部被实例化
    private Singleton1(){

    }

    public static Singleton1 getInstance(){
        return singleton;
    }
}